/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sanjose.proyectopatpro.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author Joverxito
 */
@Entity
@Table(name = "PaqueteCanal", catalog = "BDSanJose", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "PaqueteCanal.findAll", query = "SELECT p FROM PaqueteCanal p"),
    @NamedQuery(name = "PaqueteCanal.findByIdPaquete", query = "SELECT p FROM PaqueteCanal p WHERE p.idPaquete = :idPaquete")})
public class PaqueteCanal implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idPaquete", nullable = false)
    private Short idPaquete;
    @JoinColumn(name = "idPaquete", referencedColumnName = "idPaquete", nullable = false, insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Paquete paquete;
    @JoinColumn(name = "idCanal", referencedColumnName = "idCanal", nullable = false)
    @ManyToOne(optional = false)
    private Canal idCanal;

    public PaqueteCanal() {
    }

    public PaqueteCanal(Short idPaquete) {
        this.idPaquete = idPaquete;
    }

    public Short getIdPaquete() {
        return idPaquete;
    }

    public void setIdPaquete(Short idPaquete) {
        this.idPaquete = idPaquete;
    }

    public Paquete getPaquete() {
        return paquete;
    }

    public void setPaquete(Paquete paquete) {
        this.paquete = paquete;
    }

    public Canal getIdCanal() {
        return idCanal;
    }

    public void setIdCanal(Canal idCanal) {
        this.idCanal = idCanal;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPaquete != null ? idPaquete.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PaqueteCanal)) {
            return false;
        }
        PaqueteCanal other = (PaqueteCanal) object;
        if ((this.idPaquete == null && other.idPaquete != null) || (this.idPaquete != null && !this.idPaquete.equals(other.idPaquete))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.sanjose.proyectopatpro.entity.PaqueteCanal[ idPaquete=" + idPaquete + " ]";
    }
    
}
